package utils

import (
	"encoding/json"

	"github.com/sirupsen/logrus"
)

func ToJson(v any) string {
	b, err := json.Marshal(v)
	if err != nil {
		logrus.Error("json marshal error:", err)
		return ""
	}
	return string(b)
}
